﻿package org.ui {
	import flash.events.MouseEvent;

	/**
	 * ...
	 * @author TianYu
	 */
	public class Digit extends Card {
		private var _digit:int = 0;
		
		public function Digit() 
		{
			shell = shell_mc;
			showed = false;
			_mc.digit_txt.doubleClickEnabled = true;
		}
		
		private function setTxt(digit:int):void
		{
			
			var color:uint = 0;
			switch (digit) 
			{
				case 1:
					color = 0x3366CC;
					break;
				case 2:
					color = 0x00FF00;
					break;
				case 3:
					color = 0xAA0000;
					break;
				case 4:
					color = 0xCC0000;
					break;
				case 5:
				case 6:
				case 7:
				case 8:
					color = 0xFF0000;
					break;
				default:
					color = 0x3366CC;
					break;
			}
			
			_mc.digit_txt.text = digit.toString();
			_mc.digit_txt.textColor = color;
			
		}
		
		public function get digit():int
		{
			return _digit;
		}
		
		public function set digit(value:int):void
		{
			_digit = value;
			setTxt(_digit);
		}
	}
	
}
